export default {
    methods: {
        loaded (footer) {
            let tr = document.createElement('tr')
            tr.className = 'ant-table-row ant-table-row-level-0'
            tr.dataset.rowKey = 'footer'
            footer.forEach((text) => {
                let td = document.createElement('td')
                td.innerHTML = text
                tr.appendChild(td)
            })
            this.$nextTick(() => {
                const foo = setInterval(() => {
                    console.log('fooooo');
                    let tbody = document.getElementsByTagName('tbody')[0]

                    // if (tbody.childElementCount == 10 ) {
                        console.log(tbody.childElementCount);
                    if ('footer' !== tbody.lastElementChild.dataset.rowKey ) {
                        tbody.appendChild(tr)
                        clearInterval(foo)
                    } else {
                        tbody.removeChild(tbody.lastElementChild)
                        tbody.appendChild(tr)
                        clearInterval(foo)
                    }
                    // && 
                }, 1000);

            })
        },
    }
}